
NUI Chapter 4. A Motion-tracking Missile Launcher

From the website:

  Killer Game Programming in Java
  http://fivedots.coe.psu.ac.th/~ad/jg

  Dr. Andrew Davison
  Dept. of Computer Engineering
  Prince of Songkla University
  Hat yai, Songkhla 90112, Thailand
  E-mail: ad@fivedots.coe.psu.ac.th


If you use this code, please mention my name, and include a link
to the website.

Thanks,
  Andrew

============================

This directory contains 3 Java files:
  * BusInfo.java
  * TestDevMissile.java
  * TestIntrMissile.java


There are 2 batch files:
  * compile.bat
  * run.bat
     - make sure they refer to the correct location of libusbjava


----------------------------
Before Compilation/Execution:

You need to download and install:

   * libusb-win32: http://sourceforge.net/apps/trac/libusb-win32/wiki
             I downloaded libusb-win32-bin-1.2.4.0.zip
             --> The executable installs libusb-win32 into c:\Program Files\LibUSB-Win32\
             --> copy and rename the relevant DLLs in bin\ over to the OS
                   e.g. libusb0_x86.dll --> Windows\system32\libusb0.dll 
                        libusb0.sys --> Windows\systems32\drivers\libusb0.sys

   * libusbjava: http://libusbjava.sourceforge.net/wp/
             I downloaded ch.ntb.usb-0.5.9.jar and LibusbJava_dll_0.2.4.0.zip
             --> move the JAR and unzipped DLL to c:\LibUsbJava


----------------------------
Other requirements:

  * obtain a Dream Cheeky MSN Missile Launcher
       - Dream Cheeky no longer sells the MSN launcher, which was replaced by the
         Storm O.I.C. (Over Internet Control) in 2010 (http://www.dreamcheeky.com/storm-oic-missile-launcher)

       - you can still find the MSN launcher at third-party resellers and eBay

       - the MSN software is still available at Dream Cheeky, at
         http://www.dreamcheeky.com/piano/pianomanual.html


  * plug the Launcher and its webcam into two USB ports

  * Create a libusb-win32 device driver for the launcher using libusb-win32's
    inf-wizard.exe

  * Obtain some USB analysis tools:
       - USBDeview (free from http://www.nirsoft.net/utils/usb_devices_view.html) 
       - USBTrace (free 15 day trial from http://www.sysnucleus.com/)
      

----------------------------
Compilation:

> compile *.java
    // you must have libusb-win32 and libusbjava installed

----------------------------
Execution:

Before you begin:
    // you must have libusb-win32 and libusbjava installed;
    // you must have installed a libusb driver for the launcher
    // you must have plugged in the launcher 


> run BusInfo
     // report on the USB bus and any USB devices that have libusb-win32 drivers


> run TestDevMissile
     // test-rig to make the Dream Cheeky Missile Launcher rotate to the left


> run TestIntrMissile
     /* A slightly more complicated test-rig to make the Missile Launcher 
        rotate downwards, *and* use an interrupt transfer to detect
        when the down rotation limit has been reached. 

        **THIS CODE DOES NOT WORK CORRECTLY.**
        In all my tests, the interrupt timeouts
        instead of returning the correct result.
     */

----------------------------
Last updated: 31st May 2011
